package com.zbkj.service.service;

import com.zbkj.common.model.city.CityRegionEntity;
import com.zbkj.common.model.order.MerchantOrder;
import com.zbkj.common.model.order.OrderDetail;
import com.zbkj.common.model.user.UserBrokerageRecord;
import com.zbkj.common.request.*;
import com.zbkj.common.response.AgentUserRegionResponse;
import com.zbkj.common.response.SystemAdminAgentCityResponse;
import com.zbkj.common.response.UserAgentPageDataResponse;
import com.zbkj.common.model.agent.UserAgent;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.common.vo.PreOrderInfoDetailVo;

import java.util.List;
/**
* @author dazongzi
* @description UserAgentService 接口
* @date 2025-07-02
*/
public interface UserAgentService extends IService<UserAgent> {

    Boolean create(UserAgentSaveRequest userAgentSaveRequest);

    /**
     * 分页查询用户代理关系表
     * @param request 查询条件
     * @param pageParamRequest 分页对行
     * @return 查询结果
     */
    List<UserAgentPageDataResponse> getList(UserAgentSearchRequest request, PageParamRequest pageParamRequest);

    UserAgent getByUserId(Integer agentUserId, Integer id);
    UserAgent getAdminUserId(Integer adminId);

    AgentUserRegionResponse getCurAgentUserRegion();

    List<UserAgent> getByRegion(AgentCalcRequest agentCalcRequest, int agentLevel);

    void getAgentUserScale(OrderDetail orderDetail, PreOrderInfoDetailVo detailVo, Integer addressId, String categorySn);

    /**
     * 生成省市区代理的佣金记录
     *
     * @param brokerageRecordList
     * @param merchantOrder
     * @param orderDetailList
     * @param categorySn
     */
    void addAgentUserBrokerageRecord(List<UserBrokerageRecord> brokerageRecordList, MerchantOrder merchantOrder,
                                     List<OrderDetail> orderDetailList, String categorySn);

    List<SystemAdminAgentCityResponse> getCityListByUserId(Integer adminId);

    List<UserAgent> getListByAdminId(Integer adminId);

    void removeBySystemAdminId(Integer adminId);

    List<CityRegionEntity> findVillageList(String disId, CityRegionEntity cityRegionEntity);
}